﻿import mx.utils.Delegate;
import kliment.display.MCC;

/**
 * ...
 * @author	Kliment
 * @version	1.0.0
 */
class kliment.effect.text.TextAbstract {
	private var _target_tf:TextField;
	private var _clocker:MovieClip;
	private var _text:String;
	private var _lenght:Number;
	private var _i:Number = 0;
	private var _suffix:String;
	private var _suffixLenght:Number;
	
	public function TextAbstract(text:String, target_tf:TextField, suffix:String) {
		_text = text;
		_target_tf = target_tf;
		_suffix = (suffix)?suffix:'';
		_lenght = _text.length;
		_suffixLenght = _suffix.length;
		if (!target_tf._parent.clocker)
			_clocker = MCC.create(target_tf._parent, 'clocker');
		_clocker.onEnterFrame = Delegate.create(this, _render);
	}
	
	private function _render():Void { 
		
	}
	
	private function _harakiri():Void {
		_clocker.onEnterFrame = null;
		MCC.remove(_clocker);
		delete this;
	}
	
	public function remove():Void {
		_target_tf.text = _text;
		_harakiri();
	}
}